#include "LibraryRecord.h"
#include "Model.h"
#include "../IO/TxtReader.h"
#include "ModelMaker.h" 
#include "../IO/AudioReader.h"
#include <iostream>
#include <sstream>

void ModelMaker::makeModel(Model & m, LibraryRecord & lr) {
	
	//m.setLinesRed(0);
	m.switchSourceWOCount(0);
	std::cout << "\nopening book..." << std::endl;
	TxtReader reader;
	reader.makeBook(lr.textPath.at(0), lr.linesRed.at(0),m);
	m.switchSourceWOCount(1); //!!!!!!!!!
	reader.makeBook(lr.textPath.at(1), lr.linesRed.at(1),m);

	AudioReader ar;
	//std::cout << "now audio" <<"\n";
	if (lr.pathToAudio != "...") ar.makeFileList(m.rusAudio, lr.pathToAudio);
	//std::cout << "made" << "\n";
	m.switchSourceWOCount(0);

}

